// \src\i18n\index.ts
import { createI18n } from 'vue-i18n'
// 语言包
import zhCn from './zh-cn'
import en from './en'
import { getItem } from '@/utils/auth'
let locale = 'zhCn'
export const setLocal = (val: string) => {
  locale = val
}
const i18n = createI18n({
  locale: getItem('localeLang') || locale,
  globalInjection: true,
  legacy: false,
  messages: {
    zhCn,
    en,
  },
})

export default i18n
